#ifndef FILE_H
#define FILE_H

#include "files/file_item.h"

namespace Tvimeg
{
	class File : public FileItem
	{
	public:
		File(void);
		File(const FilePath& pathIn);
		File(const File& other);
		~File(void);

		File&		operator=(const File& other);

		bool		Exists(void) const;

		size_t		GetSize(void) const;

		enum Mode
		{
			MODE_READ,
			MODE_WRITE
		};

		bool		Open(const Mode mode);
		bool		OpenRead(void);
		bool		OpenWrite(void);

		bool		IsOpen(void) const;

		void		Close(void);

		bool		Read(void* data, const size_t sizeIn, size_t& sizeOut);
		bool		Write(const void* data, const size_t sizeIn, size_t& sizeOut);

	private:
		bool		OpenInternal(const char* mode);

		FILE*		file;
	};
}

#endif // FILE_H
